<div class="row">
    <div class="colxl-12 col-lg-12 col-md-12 col-sm-12 col-12">
        <div class="page-title-wrapper">
            <div class="page-title-box">
                <h4 class="page-title bold">修改密码</h4>
            </div>
            <div class="breadcrumb-list">
                <ul>
                    <li class="breadcrumb-link"><a th:href="@{admin}"><i class="fas fa-home mr-2"></i>首页</a></li>
                    <li class="breadcrumb-link active">用户</li>
                    <li class="breadcrumb-link active">修改密码</li>
                </ul>
            </div>
        </div>
    </div>
</div>
<!-- Main content -->
<section class="content">
    <div class="card table-card card-body">
        <div class="col-sm-6  offset-sm-3">
           <form  id="userInfoForm">
            <div class="form-group row">
                <label class="col-sm-3 col-form-label">输入旧密码 :</label>
                <div class="col-sm-9">
                    <input type="password" name="oldPassword" class="form-control" id="oldPassword"
                           placeholder="请填写密码" required>
                    <div class="invalid-feedback">请填写旧密码</div>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-3 col-form-label">输入新密码 :</label>
                <div class="col-sm-9">
                    <input type="password" name="newPassword" class="form-control" id="newPassword"
                           placeholder="请填写密码" required>
                    <div class="invalid-feedback">请填写新密码</div>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-3 col-form-label">确认新密码 :</label>
                <div class="col-sm-9">
                    <input type="password" name="confirmNewPassword" class="form-control" id="confirmNewPassword"
                           placeholder="请填写密码" required>
                    <div class="invalid-feedback">请填写确认新密码</div>
                </div>
            </div>
            <div class="form-group row">
                <div class="col-sm-9  offset-sm-3">
                    <button id="saveInfo" type="button" class="btn btn-info">保存</button>
                </div>
            </div>
        </form>
        </div>
    </div>
</section>

<script type="text/javascript">
    $(function () {
        $("#saveInfo").on('click', function () {
            Core.mask("#saveInfo");
            Core.postAjax("/system/changePassword",$("#userInfoForm").serialize(),function (data) {
                Core.unmask("#saveInfo");
                layer.msg(data.msg);
                if (data.status === 200) {
                    setTimeout(function () { $(location).prop('href','system/logout');}, 1000);
                }
            })

        })
    });
</script>


